import { ref } from 'vue'
import { defineStore } from 'pinia'
import { getCategoryAPI } from '@/apis/layout';

export const useCategoryStore = defineStore('category', () => {
    //导航代码数据管理
    //导航栏列表数据
    const categorylist = ref([])

    //获取数据的方法
    const getCategory = async () => {
        const res = await getCategoryAPI()
        categorylist.value = res.result
    }

    return {
        categorylist,
        getCategory
    }

})
